﻿@using FwProject.Restaurant.Dto
@using FwProject.Restaurant
@model DepositDto
@{
    Layout = null;
}
<div class="modal-dialog">
    <div class="modal-content animated fadeIn">
        <form class="form-horizontal" action="/Deposit/Edit?id=@ViewBag.Id" method="post" novalidate="novalidate" data-ajax="true" data-ajax-success="ReloadAjaxCallbackgoback" data-ajax-failure="FailureAjaxCallback" data-ajax-method="Post" role="form">
            <div class="modal-header">
                <h4 class="modal-title">修改押金信息</h4>
            </div>
            <div class="modal-body">
                <div class="form-body">
                    @Html.AntiForgeryToken()
                    @Html.TextBoxFor(o => o.FactoryinfoId, new { @class = "hidden" })
                    <div class="form-group">
                        <div class="col-md-9">
                            <label class="control-label col-md-6">单号：</label>
                            <div class="input-group">
                                <input type="text" name="CreationNumber" class="form-control" value="@Model.CreationNumber" readonly="readonly">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-9">
                            <label class="control-label col-md-6">日期：</label>
                            <div class="input-group">
                                <input type="text" name="DepositTime" id="date" class="form-control" value="@(Model.DepositTime.ToString("yyyy-MM-dd"))">
                            </div>
                        </div>
                    </div>
                    @if (Model.DepositStatus == DepositStatus.未提交 || Model.DepositStatus == DepositStatus.退回)
                    {
                        <div class="form-group">
                            <div class="col-md-9">
                                <label class="control-label col-md-6">餐厅：</label>
                                <div class="input-group" style="width:162px">
                                    <input type="hidden" name="RestaurantId" id="RestaurantId" value="@Model.RestaurantId" />
                                    <input type="text" id="dropdown-restaurantid" class="form-control" name="RestaurantName" value="@Model.RestaurantInfoModel.RestaurantName" onblur="blurEmpty()" style="width:162px">
                                    <div class="input-group-btn">
                                        <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown" style="line-height:1.455;padding:6px 12px;">
                                            <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu dropdown-menu-right" role="menu" style="z-index: 9999;"></ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    }
                    else
                    {
                        <div class="form-group">
                            <div class="col-md-9">
                                <label class="control-label col-md-6">餐厅：</label>
                                <div class="input-group">
                                    <input type="hidden" name="RestaurantId" value="@Model.RestaurantId" />
                                    <input type="text" name="RestaurantName" class="form-control" value="@Model.RestaurantInfoModel.RestaurantName" readonly="readonly">
                                </div>
                            </div>
                        </div>

                    }
                    <div class="form-group">
                        <div class="col-md-9">
                            @if (Model.DepositType == DepositType.收押金)
                            {
                                <label class="control-label col-md-6">押金金额：</label>
                                <div class="input-group">
                                    <input type="text" name="Money" id="CollectMoney" class="form-control" value="@Model.Money" oninput="setCollectMoney(this)">
                                </div>

                            }
                            else
                            {
                                <label class="control-label col-md-6">退回金额：</label>
                                <div class="input-group">
                                    <input type="text" name="Money" id="ReturnMoney" class="form-control" value="@Model.Money" oninput="setReturnMoney(this)">
                                </div>
                            }
                            <input type="hidden" name="ModifiableAmount" id="ModifiableAmount" value="@ViewBag.ModifiableAmount" />
                        </div>
                    </div>
                    @if (Model.DepositStatus == DepositStatus.未提交)
                    {
                        <div class="form-group">
                            <div class="col-md-9">
                                @if (Model.DepositType == DepositType.收押金)
                                {
                                    <label class="control-label col-md-6">收款账户：</label>
                                }
                                else
                                {
                                    <label class="control-label col-md-6">付款账户：</label>
                                }
                                <div class="input-group" style="width:162px">
                                    <input type="hidden" name="CapitalAccountId" id="CapitalAccountId" value="@Model.CapitalAccountId" />
                                    <input type="text" id="dropdown-capitalaccountid" class="form-control" value="@Model.AccountName" onblur="blurEmpty1()" style="width:162px">
                                    <div class="input-group-btn">
                                        <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown" style="line-height:1.455;padding:6px 12px;">
                                            <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu dropdown-menu-right" role="menu" style="z-index: 9999;"></ul>
                                    </div>
                                </div>
                            </div>
                        </div>

                    }
                    else
                    {
                        <div class="form-group">
                            <div class="col-md-9">
                                @if (Model.DepositType == DepositType.收押金)
                                {
                                    <label class="control-label col-md-6">收款账户：</label>
                                }
                                else
                                {
                                    <label class="control-label col-md-6">付款账户：</label>
                                }
                                <div class="input-group">
                                    <input type="hidden" name="CapitalAccountId" value="@Model.CapitalAccountId" />
                                    <input type="text" name="AccountName" class="form-control" value="@Model.AccountName" readonly="readonly">
                                </div>
                            </div>
                        </div>
                    }
                    @if (Model.DepositStatus == DepositStatus.未提交)
                    {
                        <div class="form-group">
                            <div class="col-md-9">
                                <label class="control-label col-md-6">经办人：</label>
                                <div class="input-group" style="width:162px">
                                    <input type="hidden" name="AgentPeoperUserId" id="AgentPeoperUserId" value="@Model.AgentPeoperUserId" />
                                    <input type="text" id="dropdown-agentpeoperuserid" class="form-control" value="@Model.AgentPeoper" onblur="blurEmpty2()" style="width:162px">
                                    <div class="input-group-btn">
                                        <button type="button" class="btn btn-white dropdown-toggle" data-toggle="dropdown" style="line-height:1.455;padding:6px 12px;">
                                            <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu dropdown-menu-right" role="menu" style="z-index: 9999;"></ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    }
                    else
                    {
                        <div class="form-group">
                            <div class="col-md-9">
                                <label class="control-label col-md-6">经办人：</label>
                                <div class="input-group">
                                    <input type="hidden" name="AgentPeoperUserId" value="@Model.AgentPeoperUserId" />
                                    <input type="text" name="AgentPeoper" class="form-control" value="@Model.AgentPeoper" readonly="readonly">
                                </div>
                            </div>
                        </div>
                    }
                    <div class="form-group">
                        <div class="col-md-9">
                            <label class="control-label col-md-6">备注：</label>
                            <div class="input-group">
                                <textarea class="form-control" name="RemarkContent">@Model.RemarkContent</textarea>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="modal-footer">
                    <button type="reset" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-primary" data-loading-text="执行中...">保存</button>
                </div>
            </div>
        </form>
    </div>
</div>




